package org.ikastola

import java.lang.invoke.MethodHandleNatives.Constants;
import java.util.Date;
import ikastola.Constants

class ItemDetail {

	String name
	String isdiscount
	Double value
	String description
	String period
	Date paymentdate //fecha a la que corresponde el pago
	Double valueFee
	Date classCreated
	Date classUpdated
	Integer deleted
	List details
	
	static hasMany = [details: ItemDetailChild] 
			
	static constraints = {
		name blank:false
		isdiscount inList: ['1', '2'] //1: Si, 2: No
		value blank:false
		description blank:false
		period inList: [Constants.FEE_PERIOD_MONTH, Constants.FEE_PERIOD_ANNUAL] //1: mensual, 2: anual
		valueFee blank:false
		classCreated nullable: true
		classUpdated nullable: true
		paymentdate nullable: true
		details nullable: true
		deleted blank: false
	}
}
